package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.QuestionnaireResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface QuestionnaireResultMapper extends BaseMapper<QuestionnaireResult> {

    @Select("SELECT * FROM `tb_questionnaire_result` WHERE questionnaire_id = #{questionnaireId} AND min_score<= #{presentScore} AND max_score>= #{presentScore}")
    QuestionnaireResult  findResult(@Param("questionnaireId") Integer questionnaireId, @Param("presentScore") Integer presentScore);
}
